package be.vanbaelvandaele.tuxremote;

import android.content.Context;

public class RhythmboxMediaPlayer implements MediaPlayerInterface {

	private Context context;
	
	public RhythmboxMediaPlayer(Context context) {
		this.context = context;
	}
	
	@Override
	public String next() {
		return SshService.get(context).executeCommand("qdbus org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player next");
	}

	@Override
	public String playPause() {
		return SshService.get(context).executeCommand("qdbus org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player playPause true");
	}

	@Override
	public String previous() {
		return SshService.get(context).executeCommand("qdbus org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player previous");
	}

	@Override
	public String stop() {
		return null;
	}

	@Override
	public String setVolume(int volume) {
		return SshService.get(context).executeCommand("qdbus org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player setVolume "
				+ (float) volume / 100);

	}

	public Context getContext() {
		return context;
	}

	public void setContext(Context context) {
		this.context = context;
	}

}
